package com.zhichat.infrastructure.Enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName: AppUpdatePublishStatusEnum
 * @Description: APP版本发布状态enum
 * @Author: 团长九哥 https://space.bilibili.com/602197686
 * @CreateDate: 2024/11/25 19:57
 */
@Getter
@AllArgsConstructor
public enum AppVersionPublishStatusEnum {
    NOT_PUBLISHED(1, "未发布"),
    PUBLISHED_ANY(2, "灰度发布"),
    PUBLISHED_ALL(3, "全网发布");
    private final Integer code;
    private final String desc;

    public static AppVersionPublishStatusEnum getByCode(Integer code) {
        for (AppVersionPublishStatusEnum appVersionPublishStatusEnum : AppVersionPublishStatusEnum.values()) {
            if (appVersionPublishStatusEnum.getCode().equals(code)) {
                return appVersionPublishStatusEnum;
            }
        }
        return null;
    }
}
